<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <button id="btn">抽奖</button>
  <div id="show"></div>
  <script>
    var arr = ["10亿现金", "跑车", "别墅", "家电", "耳机", "充电宝", "糖果"];
    // 获取按钮绑定点击事件
    var btn = document.getElementById("btn");
    var show = document.getElementById("show")
    btn.onclick = function () {
      // 给数组随机一个下标
      var num = Math.floor(Math.random() * arr.length); //0-6
      show.innerHTML = arr[num];//显示奖品
    }



  </script>
</body>

</html>